home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1179 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.6 KB

  1. From: Thomas Binder (Gryf) <binder@rbg.informatik.th-darmstadt.de>
  2. Subject: Probs with MiNTLib
  3. Date: Wed, 9 Mar 94 13:29:35 MEZ
  4. Return-Receipt-To: binder@rbg.informatik.th-darmstadt.de
  5. Mailer: Elm [revision: 66.25]
  6.  
  7. Hi all!
  8.  
  9. As I played around with the MiNTLibs (PL 42, but the diffs to 43 and 44 show
  10. no differences in the files concerning my problems) I recognized two things:
  11.  
  12. - scanf doesn't work properly with plain TOS
  13. - on TOS 4.01 stderr won't work
  14.  
  15. The first problem is due to the function _read (in read.c). Fread (which is
  16. called in there) doesn't add the linefeed/cr to the buffer when the user
  17. completed the input by pressing return. So scanf still waits for the whitespace
  18. to end the input line, and you have to press return twice.
  19. As said before, this only happens *without* MiNT running. I solved the problem
  20. by always adding a linefeed to the buffer when MiNT is not running and the
  21. file read from is a tty. Is that OK?
  22.  
  23. The second problem is due to an error(?) in the Falcon-TOS: Fforce(2, -1)
  24. returns EINHNDL, so anything written to stderr never appears on the screen.
  25. As far as I know, this Fforce-call was documented by ATARI, so I wondered why
  26. it didn't work. I then tried calling Fopen("CON:", 2) and *suprise*: I get
  27. handle 6, instead of -1 (as said in the german 'Profibuch'). So one solution
  28. (useable for all TOS-versions) would be calling Fforce(2, Fdup(1)), but since
  29. Fdup has some severe problems, I didn't use this way. Instead, I tried calling
  30. Fforce(2, Fopen("CON:", 2)), this works very nice. On old TOSes, the Fopen-
  31. call returns -1, on newer ones 6 (or higher), and Fforce will work again. The
  32. only disadvantage of this method is the the handle returned by the Fopen-call
  33. has to be closed (if it is >= 6), but that can easily be done in function
  34. exit. What do you think about that?
  35.  
  36.  
  37. If this suggestions are useable, I'll post the diffs later (could take some
  38. time).
  39.  
  40.  
  41. Ciao
  42.  
  43. Thomas
  44.  
  45.  
  46. --
  47. /----------------------------------------------------------------------------\
  48. | Thomas Binder (IRCNick: Gryf)                | "It all seems so stupid, it |
  49. | Hauptstrasse 43b                             |  makes me want to give up,  |
  50. | 61169 Friedberg                              |  but why should I give up,  |
  51. | Germany                                      |  when it all seems so       |
  52. | Email: binder@rbg.informatik.th-darmstadt.de |  stupid?" M. L. Gore        |
  53. |----------------------------------------------------------------------------|
  54. |       Auf frischer Tat ertappt - Dunkelheit bei Einbruch verhaftet!        |
  55. \----------------------------------------------------------------------------/
  56.